//
//  ICMMaintenanceAndPartsView.h
//  ICrEAM
//
//  Created by FoREVer_SaD on 16/10/27.
//  Copyright © 2016年 mac. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "ICMTitleTextFeildView.h"
@class ICMPartsTopModel;
@class ICMRepairMaintenancesModel;
@class ICMRepairPartsArrayModel;

@protocol ICMMaintenanceAndPartsViewDelegate <NSObject>

- (void)showRepairEventAndSearchViewWithRepairType:(NSString *)repairType;

@end

@interface ICMMaintenanceAndPartsView : UIView
@property (nonatomic, strong) UITableView *repairEventTableView;

@property (nonatomic, strong) UITableView *repairPartsTableView;
@property (nonatomic, strong) ICMTitleTextFeildView *workingUnitPriceView;
@property (nonatomic, strong) ICMTitleTextFeildView *workingPriceView;
@property (nonatomic, strong) ICMTitleTextFeildView *partsPriceView;
@property (nonatomic, strong) ICMTitleTextFeildView *totalPriceView;


@property (nonatomic, strong) ICMTitleTextFeildView *workingRatioView;
@property (nonatomic, strong) ICMTitleTextFeildView *partsRatioView;
@property (nonatomic, strong) ICMTitleTextFeildView *discountedPrice;

@property (nonatomic, strong) ICMTitleTextFeildView *finishTimeView;

@property (nonatomic, weak) id<ICMMaintenanceAndPartsViewDelegate> delegate;

@property (nonatomic, strong) NSMutableArray *repairEventArray;

@property (nonatomic, strong) NSMutableArray *repairPartsArray;

@property (nonatomic, strong) NSMutableArray *repairTypes;

@property (nonatomic, assign) BOOL isPayForType;//是否索赔维修类型

@property (nonatomic, strong) NSString *modelCode;//查询时要传车型
@property (nonatomic, strong) ICMTitleTextFeildView *carTypeView;

@property (nonatomic, strong) NSString *SERIES_LABOUR_PRICE;//车系单价

//用于保存删除的项目零件model
@property (nonatomic, strong) NSMutableArray *delRepairPartsArray;
@property (nonatomic, strong) NSMutableArray *delRepairEventArray;

//选中需要删除的零件或项目index
@property (nonatomic, assign) NSInteger wishDeleteIndex;

//@property (nonatomic, strong) UIButton *partRatioButton;
//@property (nonatomic, strong) UIButton *eventRatioBUtton;

//保存成功后需要将所有的零件和项目状态初始化
- (void)setAllStateToInit;

- (void)resetRepairTypeButtonWithNotification:(NSDictionary *)dic;

+ (instancetype)createICMMaintenanceAndPartsViewWithFrame:(CGRect)frame;

//编辑模式调用
- (void)setupPartsViewWithPartsTopModel:(ICMPartsTopModel*)topModel;
- (void)setupPartsViewWithRepairMaintenancesModel:(ICMRepairMaintenancesModel*)repairMaintenancesModel;
- (void)setupPartsViewWithRepairPartsArrayModel:(ICMRepairPartsArrayModel*)repairPartsArrayModel;
- (void)refreshInEditType;


@end
